﻿using Hotel.DAL;
using Hotel.Model;

namespace Hotel.BLL
{
    public class LoginBLL
    {
        public LoginBLL(LoginDAL loginDAL)
        {
            LoginDAL = loginDAL;
        }

        public LoginDAL LoginDAL { get; }

        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="login"></param>
        /// <returns></returns>
        public int Add(Login login)
        {
            try
            {
                return  LoginDAL.Add(login);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public Login Login(string name)
        {
            try
            {
                return LoginDAL.Login(name);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}